<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>{$title} - <tp:sitename /></title>
    <meta name="keywords" content="{$keywords}" />
    <meta name="description" content="{$description}" />
    <link rel="shortcut icon" href="__PUBLIC__/images/favicon.ico" type="image/x-icon" /> 
    <link rel="stylesheet" href="__PUBLIC__/css/style_version1.css" type="text/css" />
    <link href="__PUBLIC__/css/member.css" rel="stylesheet" type="text/css" />
    <script src="__PUBLIC__/js/jquery.js" type="text/javascript"></script>
</head> 
<body> 

<include file="Public:header" />

<div class="container clearfix">
    
    <include file="Member:left" />
    
    <div class="member_main">
        <div class="perInfo">
            <div class="titleInfoBorder">
                <span>我的设置</span>
            </div>
            <div class="firstTabBox lineSpace">
                <a class="tab" href="{:U('Member/person')}">个人资料</a>
                <span class="line">|</span>
                <a class="tab" href="{:U('Member/avatar')}">头像设置</a>
                <span class="line">|</span>
                <a class="tab currentTab" href="{:U('Member/email')}">邮箱验证</a>
                <span class="line">|</span>
                <a class="tab" href="{:U('Member/password')}">修改密码</a>
            </div>
        </div>
        <div class="setting-right-wrap wrap-boxes settings">
            <div id="setting-profile" class="setting-wrap setting-profile">

                <div class="setting-verify">
                    <h1>当前邮箱</h1>
                    <p>{:get_cookie('email')}</p>
                    
                    <if condition="get_cookie('status') eq 0">
                    <div class="verify-status verified-status">
                       <span class="verify-un">邮箱未验证</span>
                    </div>
                    <button id="email_check" class="btn-green btn">发送验证邮件</button>
                    <else/>
                    邮箱已验证
                    </if>
                    
               	</div>
            </div>
        </div>
    </div>
    
</div>

<include file="Public:footext" />
<include file="Member:mfooter" />
<script type="text/javascript">
    $(function() {
        $("#email_check").click(function() {
            var obj = $(this);
            obj.addClass("disabled").text("正在发送...");
            $.get(getUrl("Ajax-email_check"), function(data) {
				if(data == '1'){
					obj.html("<span id='second'>60</span>秒后重新发送").css({"cursor": "default"}).attr("disabled", "disable");
					intervalId = setInterval("exit()", 1000);
					i = 59;
				}else{
					alert(data);
				}
            })
        })
    })

    function exit() {
        $("#second").text(i);
        i = i - 1;
        if (i < 0) {
            clearInterval(intervalId);
            $("#email_check").text("发送验证邮件").removeClass("disabled").css({"cursor": "pointer"}).removeAttr("disabled");
        }
    }
</script>
</body>
</html>
